package com.bsj.sipgateway.sip.bean;

/**
 * @Description
 * @Author zhaoyang
 * @Date 2024/6/24 16:50
 */
public enum  DeviceAlarmMethodEnum {

    // 1为电话报警
    Telephone(1),

    // 2为设备报警
    Device(2),

    // 3为短信报警
    SMS(3),

    // 4为 GPS报警
    GPS(4),

    // 5为视频报警
    Video(5),

    // 6为设备故障报警
    DeviceFailure(6),

    // 7其他报警
    Other(7);


    private final int val;

    DeviceAlarmMethodEnum(int val) {
        this.val = val;
    }

    public int getVal() {
        return val;
    }


    /**
     * @param code
     * @return: com.bsj.power.video.bean.DeviceAlarmMethodEnum
     * @decription 查询是否匹配类型
     * @author zhaoyang
     * @date 2024/4/30 10:02
     */
    public static DeviceAlarmMethodEnum typeOf(int code) {
        for (DeviceAlarmMethodEnum item : DeviceAlarmMethodEnum.values()) {
            if (code == item.getVal()) {
                return item;
            }
        }
        return null;

    }

}
